<template>
  <footer class="footer">
    <div class="footer-main">
      <div class="footer-left">
        <div class="footer-logo-row">
          <div class="footer-logo">
            <el-icon style="font-size: 3rem;"><Monitor /></el-icon>
          </div>
          <div class="footer-title">
            <div class="footer-title-main">中国小麦品质数字地图</div>
            <div class="footer-title-sub">与品质评定系统</div>
          </div>
        </div>
        <div class="footer-desc">
          我们建立了一个小麦品质数据库。我们的团队为高校、科研院所、企业等用户提供一个全面、准确、专业的小麦品质研究和管理工具。
        </div>
        <div class="footer-social">
          <el-icon class="footer-social-icon"><ChatDotRound /></el-icon>
          <el-icon class="footer-social-icon"><Bell /></el-icon>
        </div>
      </div>
      <div class="footer-links">
        <div class="footer-link-group">
          <div class="footer-link-title">平台</div>
          <router-link to="/about" class="footer-link">简介</router-link>
          <router-link to="/news" class="footer-link">新闻中心</router-link>
          <router-link to="/detection" class="footer-link">检测方法</router-link>
        </div>
        <div class="footer-link-group">
          <div class="footer-link-title">工具</div>
          <a class="footer-link" href="#" @click.prevent>品质对比</a>
          <a class="footer-link" href="#" @click.prevent>品质评价</a>
          <a class="footer-link" href="#" @click.prevent>数据上传</a>
        </div>
        <div class="footer-link-group">
          <div class="footer-link-title">帮助中心</div>
          <router-link to="/about#contact" class="footer-link">联系我们</router-link>
          <a class="footer-link" href="#" @click.prevent>后台管理</a>
        </div>
      </div>
    </div>
    <div class="footer-bottom">
      <div class="footer-copyright">
        © Copyright 2024 小麦品质检测, Inc.
      </div>
      <div class="footer-lang">
        <el-icon><Setting /></el-icon>
        <span>简体中文</span>
      </div>
      <button class="footer-top-btn" @click="scrollToTop">
        <el-icon><ArrowUp /></el-icon>
      </button>
    </div>
  </footer>
</template>

<script>
export default {
  name: 'Footer',
  methods: {
    scrollToTop() {
      window.scrollTo({ top: 0, behavior: 'smooth' })
    }
  }
}
</script>

<style scoped>
.footer {
  background: #fff;
  color: var(--color-primary);
  border-top: 1.5px solid var(--color-primary-light);
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
  font-size: 1rem;
  margin-top: 4rem;
}
.footer-main {
  display: flex;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  gap: 2rem;
}
.footer-left {
  flex: 1.5;
  min-width: 320px;
}
.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}
.footer-logo {
  background: var(--color-primary-light);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.footer-title-main {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--color-primary);
  letter-spacing: 1px;
}
.footer-title-sub {
  font-size: 1.1rem;
  color: var(--color-primary);
  opacity: 0.85;
}
.footer-desc {
  margin: 1.2rem 0 1.5rem 0;
  color: var(--color-text-light);
  line-height: 1.7;
  font-size: 1.05rem;
}
.footer-social {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.5rem;
}
.footer-social-icon {
  font-size: 2rem;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: 50%;
  padding: 0.3rem;
  transition: background 0.2s;
  cursor: pointer;
}
.footer-social-icon:hover {
  background: #b7e1cd;
}
.footer-links {
  flex: 2;
  display: flex;
  justify-content: space-between;
  gap: 2.5rem;
}
.footer-link-group {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.footer-link-title {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.7rem;
  color: var(--color-primary);
}
.footer-link {
  color: var(--color-primary);
  text-decoration: none;
  opacity: 0.9;
  transition: color 0.2s, opacity 0.2s;
  font-size: 1rem;
}
.footer-link:hover {
  color: #218c5c;
  opacity: 1;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 2.5rem auto 0 auto;
  padding: 0 2rem;
  border-top: 1px solid var(--color-primary-light);
  padding-top: 1.2rem;
  font-size: 0.98rem;
  position: relative;
}
.footer-lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-primary);
  opacity: 0.85;
}
.footer-top-btn {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20,90,50,0.08);
  transition: background 0.2s;
}
.footer-top-btn:hover {
  background: #b7e1cd;
}
@media (max-width: 900px) {
  .footer-main {
    flex-direction: column;
    gap: 2.5rem;
    align-items: flex-start;
  }
  .footer-links {
    width: 100%;
    justify-content: flex-start;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: 2.5rem;
  }
  .footer-top-btn {
    position: static;
    margin-top: 1rem;
    align-self: flex-end;
  }
}
</style>
